﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace Server
{
    public class AccessConfigFile
    {
        public static void WriteFile(string data, string fileName)
        {
            try
            {
                StreamWriter writer = new StreamWriter(Application.StartupPath + @"\Config\" + fileName);
                writer.Write(data);
                writer.Flush();
                writer.Close();
                writer.Dispose();
            }
            catch
            {}
        }

        public static string ReadFile(string fileName)
        {
            try
            {
                StreamReader reader = new StreamReader(Application.StartupPath + @"\Config\" + fileName);
                return reader.ReadToEnd();
            }
            catch
            {
                return null;
            }
        }
    }
}
